a=input()
h1=0
h2=0
h3=0
dg=0
if a[0]=="z":
    h1=0
if a[0]=="o":
    h1=1
if a[0]=="t" and a[1]=="w":
    h1=2
if a[0]=="t" and a[1]=="h":
    h1=3
if a[0]=="f" and a[1]=="o":
    h1=4
if a[0]=="f" and a[1]=="i":
    h1=5
if a[0]=="s" and a[1]=="i":
    h1=6
if a[0]=="s" and a[1]=="e":
    h1=7
if a[0]=="e":
    h1=8
if a[0]=="n":
    h1=9

for i in range(len(a)):
    if a[i]=="1" or a[i]=="2" or a[i]=="3" or a[i]=="4" or a[i]=="5" or a[i]=="6" or a[i]=="7" or a[i]=="8" or a[i]=="9":
        dg=1
        print(" Wrong input")
        break
    if a[i]=="z" and a[i-1]==" ":
             h2=0
    if a[i]=="o" and a[i-1]==" ":
            h2=1
    if a[i]=="t" and a[i+1]=="w" and a[i+2]=="o":
            h2=2
    if a[i]=="t" and a[i+1]=="h" and a[i+2]=="r" and a[i-1]==" ":
            h2=3
    if a[i]=="f" and a[i+1]=="o" and a[i-1]==" ":
            h2=4
    if a[i]=="f" and a[i+1]=="i" and a[i-1]==" ":
            h2=5
    if a[i]=="s" and a[i+1]=="i" and a[i-1]==" ":
            h2=6
    if a[i]=="s" and a[i+1]=="e" and a[i-1]==" ":
            h2=7
    if a[i]=="e" and a[i-1]==" ":
            h2=8
    if a[i]=="n" and a[i-1]==" ":
            h2=9
    if i>7:
         if (a[i]=="o" or a[i]=="z" or a[i]=="t" and a[i+1]=="w") and a[i-1]==" ":
            h3=1
         if (a[i]=="f" and a[i+1]=="i"  or a[i]=="f" and a[i+1]=="o" or a[i]=="t" and a[i+1]=="h")and a[i-1]==" ":
            h3=5
         if (a[i]=="s" and a[i+1]=="i" or a[i]=="s" and a[i+1]=="e" or a[i]=="e" or a[i]=="n") and a[i-1]==" ":
            h3=7
if dg==0:
 print(h1,h2,h3,end=" ")
